package spring_mvc.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import spring_mvc.model.User;

import java.util.List;

@Repository
public class UserDao {
    @Autowired
    private UserMapper userMapper;

    public List<User> findALl(){
        List<User> userList = userMapper.findAll();
        return userList;
    }

    public int save(User user){
        return userMapper.save(user);
    }

    public int update(String name,String sex,int id){
        return userMapper.update(name,sex,id);
    }

    public int delete(int id){
        return userMapper.delete(id);
    }

}
